package com.scs.application.modules.dept.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.scs.application.core.entity.DataEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityIndexAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
/**
 * <p>
 *
 * </p>
 *
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "科室消耗明细表")
@TableName("dept_use_dtl")
@EntityIndexAnnotation(ix = {"use_id","flag_omoc","flag_consignment","supplier_id","sn_no","matr_id", "use_time"})
public class UseDtl extends DataEntity {

    @EntityFieldAnnotation(
            text = "外键",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String useId;

    @EntityFieldAnnotation(
            text = "库存ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = "锁库库存ID"
    )
    private String stockId;

    @EntityFieldAnnotation(
            text = "物料ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String matrId;

    @EntityFieldAnnotation(
            text = "品名",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "冗余字段"
    )
    private String matrName;

    @EntityFieldAnnotation(
            text = "品规",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "冗余字段"
    )
    private String matrSpec;

    @EntityFieldAnnotation(
            text = "单位",
            length = "10",
            not_null = false,
            default_value = "",
            comment = "冗余字段"
    )
    private String matrUnit;

    @EntityFieldAnnotation(
            text = "包装单位",
            length = "10",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String packageUnit;

    @EntityFieldAnnotation(
            text = "包装数量",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Double packageQty;

    @EntityFieldAnnotation(
            text = "数量",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Double skuQty;

    @EntityFieldAnnotation(
            text = "单价",
            length = "",
            not_null = false,
            default_value = "",
            comment = "库存单价"
    )
    private Double skuPrice;

    @EntityFieldAnnotation(
            text = "金额",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Double amount;

    @EntityFieldAnnotation(
            text = "批次",
            length = "30",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String lot;

    @JSONField(format = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @EntityFieldAnnotation(
            text = "效期",
            type = EntityFieldType.DATE,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Date expDate;

    @EntityFieldAnnotation(
            text = "SN",
            length = "30",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String snNo;

    @EntityFieldAnnotation(
            text = "RFID",
            length = "30",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String rfid;

    @EntityFieldAnnotation(
            text = "备注",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String remark;

    @EntityFieldAnnotation(
            text = "取用人",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String user;

    @EntityFieldAnnotation(
            text = "取用时间",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Date useTime;

    @EntityFieldAnnotation(
            text = "供应商ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = "供应商ID"
    )
    private String supplierId;

    @EntityFieldAnnotation(
            text = "默认供应商名字",
            length = "100",
            default_value = "",
            comment = "供应商名字"
    )
    private String supplierName;

    @EntityFieldAnnotation(
            text = "是否寄售",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Boolean flagConsignment;

    @EntityFieldAnnotation(
            text = "是否一物一码",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Boolean flagOmoc;

    @EntityFieldAnnotation(
            text = "",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String mfgName;

    @EntityFieldAnnotation(
            text = "耗材型号",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "耗材型号"
    )
    private String matrModel;

    @EntityFieldAnnotation(
            text = "参考ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = "来源单据ID"
    )
    private String refId;


    @EntityFieldAnnotation(
            text = "finance_bill.id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String billId;
    @EntityFieldAnnotation(
            text = "finance_bill_item.id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String billItemId;

    @JsonFormat(pattern="yyyy/MM/dd", timezone = "GMT+8")
    @EntityFieldAnnotation(
            text = "生产日期",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Date mfgDate;

    @EntityFieldAnnotation(
            text = "注册证号",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String certificateNo;


    /**
    * @Description： 主单单号，此字段应该叫useKey 或者busKey ，为了避免其他查询重复字段，使用mainKey
    * @Author wyt
    * @Date 2022/1/12
    */
    @TableField(exist = false)
    private String mainKey;

    @EntityFieldAnnotation(
            text = "原始入库单明细ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String lineId;
}
